Optimal. Leaf size=102 \[ -\frac {2^{-1+n} F_1\left (-\frac {1}{2};-2+n,1;\frac {1}{2};-\frac {a-a \sec (c+d x)}{a+a \sec (c+d x)},\frac {a-a \sec (c+d x)}{a+a \sec (c+d x)}\right ) \cot (c+d x) \left (\frac {1}{1+\sec (c+d x)}\right )^{-1+n} (a+a \sec (c+d x))^n}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps
used = 1, number of rules used = 1, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {3974}
\begin {gather*} -\frac {2^{n-1} \cot (c+d x) \left (\frac {1}{\sec (c+d x)+1}\right )^{n-1} (a \sec (c+d x)+a)^n F_1\left (-\frac {1}{2};n-2,1;\frac {1}{2};-\frac {a-a \sec (c+d x)}{\sec (c+d x) a+a},\frac {a-a \sec (c+d x)}{\sec (c+d x) a+a}\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3974
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+a \sec (c+d x))^n \, dx &=-\frac {2^{-1+n} F_1\left (-\frac {1}{2};-2+n,1;\frac {1}{2};-\frac {a-a \sec (c+d x)}{a+a \sec (c+d x)},\frac {a-a \sec (c+d x)}{a+a \sec (c+d x)}\right ) \cot (c+d x) \left (\frac {1}{1+\sec (c+d x)}\right )^{-1+n} (a+a \sec (c+d x))^n}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(893\) vs. \(2(102)=204\).
time = 3.91, size = 893, normalized size = 8.75 \begin {gather*} \frac {(a (1+\sec (c+d x)))^n \left (-2^n \cot \left (\frac {1}{2} (c+d x)\right ) \, _2F_1\left (-\frac {1}{2},n;\frac {1}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )\right )^n \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^n (1+\sec (c+d x))^{-n}+2^n \, _2F_1\left (\frac {1}{2},n;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )\right )^n \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^n (1+\sec (c+d x))^{-n} \tan \left (\frac {1}{2} (c+d x)\right )-\frac {60 F_1\left (\frac {1}{2};n,1;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \cos ^2\left (\frac {1}{2} (c+d x)\right ) \cos (c+d x) \sin (c+d x) \left (3 F_1\left (\frac {1}{2};n,1;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-2 \left (F_1\left (\frac {3}{2};n,2;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-n F_1\left (\frac {3}{2};1+n,1;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}{45 F_1\left (\frac {1}{2};n,1;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ){}^2 \cos ^2\left (\frac {1}{2} (c+d x)\right ) (1+2 n-2 n \cos (c+d x)+\cos (2 (c+d x)))+6 F_1\left (\frac {1}{2};n,1;\frac {3}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \sin ^2\left (\frac {1}{2} (c+d x)\right ) \left (-5 F_1\left (\frac {3}{2};n,2;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) (1+2 n-2 (2+n) \cos (c+d x)+\cos (2 (c+d x)))+5 n F_1\left (\frac {3}{2};1+n,1;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) (1+2 n-2 (2+n) \cos (c+d x)+\cos (2 (c+d x)))-48 \left (2 F_1\left (\frac {5}{2};n,3;\frac {7}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-2 n F_1\left (\frac {5}{2};1+n,2;\frac {7}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )+n (1+n) F_1\left (\frac {5}{2};2+n,1;\frac {7}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )\right ) \cot (c+d x) \csc (c+d x) \sin ^4\left (\frac {1}{2} (c+d x)\right )\right )+40 \left (F_1\left (\frac {3}{2};n,2;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-n F_1\left (\frac {3}{2};1+n,1;\frac {5}{2};\tan ^2\left (\frac {1}{2} (c+d x)\right ),-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )\right ){}^2 \cos (c+d x) \sin ^2\left (\frac {1}{2} (c+d x)\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right )}\right )}{2 d} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.10, size = 0, normalized size = 0.00 \[\int \left (\cot ^{2}\left (d x +c \right )\right ) \left (a +a \sec \left (d x +c \right )\right )^{n}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \left (\sec {\left (c + d x \right )} + 1\right )\right )^{n} \cot ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {cot}\left (c+d\,x\right )}^2\,{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^n \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________